package dump;

import android.content.ContentValues;
import android.database.Cursor;

public abstract class DatabaseCollection {
	protected Cursor cursor;

	public DatabaseCollection(final Cursor cursor) {
		this.cursor = cursor;
	}

	public void close() {
		this.cursor.close();
	}

	public abstract ContentValues cursorToValues(Cursor cursor);

	public boolean hasNext() {
		return !this.cursor.isLast();
	}

	public ContentValues next() {
		final ContentValues values = null;

		if (this.cursor.moveToNext()) {
			return this.cursorToValues(this.cursor);
		}

		return values;
	}

}
